package com.zzy.eventbus.subdemo;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
import com.zzy.eventbus.subdemo.base.EventListener;
import com.zzy.eventbus.subdemo.base.SystemEvent;

/**
 * 测试事件监听类
 * @author Jack
 *
 */
public class TestEventListener implements EventListener{
    

    @Override
    @Subscribe
    @AllowConcurrentEvents
    public void action(SystemEvent event) {
        System.out.println(String.format("[TestEventListener ]: listener=%s ------- event=%s", this.toString(), event.toString()));
        TestEvent subEvent = (TestEvent) event ;
        invoke(subEvent) ;
    }
    
    public void invoke(TestEvent testEvent) {
    	System.out.println(String.format("[TestEventListener ]: Event=%s", testEvent.toString()));
    }

}


